Network

A service that provides access to the network-level functionality.

Functions

Link copied to clipboard
abstract fun acceptLanguage(): String
Returns a string that represents the Accept-Language request-header field.
abstract fun acceptLanguage(language: String)
Configures the accept language.
Link copied to clipboard
inline fun <C : Callback> Advisable<in C>.callback(): C?
inline fun <C : Callback> Advisable<in C>.callback(): C?

Returns the currently registered callback of type C, if any.

Link copied to clipboard
abstract fun <C : P?> get(callbackClass: Class<C>): Optional<C>
Returns an Optional that contains the callback of the given type or an empty Optional if there is no registered callback with the given type.
Link copied to clipboard
Returns an HTTP authorization preferences.
Link copied to clipboard
abstract fun <E : T?> on(eventClass: Class<E>, observer: Observer<E>): Subscription
Subscribes the given event observer to receive the events of the given eventClass.
Link copied to clipboard
abstract fun profile(): Profile
Returns the profile of this service.
Link copied to clipboard
inline fun <C : Callback> Advisable<in C>.register(callback: C): C?
inline fun <C : Callback> Advisable<in C>.register(callback: C): C?

Registers the given callback in this Advisable.

Link copied to clipboard
abstract fun <C : P?> remove(callbackClass: Class<C>): C
Removes a particular service callback.
Link copied to clipboard
inline fun <C : Callback> Advisable<in C>.removeCallback(): C?
inline fun <C : Callback> Advisable<in C>.removeCallback(): C?

Removes a callback of type C from this Advisable, if any.

Link copied to clipboard
abstract fun <C : P?> set(callbackClass: Class<C>, callback: C): C
Sets a particular service callback.
Link copied to clipboard
inline fun <E : Event> Observable<in E>.subscribe(observer: Observer<E>): Subscription
inline fun <E : Event> Observable<in E>.subscribe(observer: Observer<E>): Subscription

Subscribes the given observer to receive events of type E from this Observable.

Link copied to clipboard
abstract fun userAgent(): String
Returns a string that represents the default user-agent.